package org.westos.service;

import org.springframework.stereotype.Service;
import org.westos.dao.YaoDao;
import org.westos.pojo.ChuFangYao;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
@Service
public class YaoServiceImpl implements YaoService {
    @Autowired
    private YaoDao yaoDao;

    @Override
    public Integer addYao(ChuFangYao chuFangYao) {
        if(!isNull(chuFangYao)){
            //TODO： dao.xxx
            yaoDao.addChuFangYao(chuFangYao);
            return 1;
        }else {
            return 2;
        }
    }

    @Override
    public List<ChuFangYao> queryYao(Integer pre_id) {
        return null;
    }

    @Override
    public boolean isNull(ChuFangYao chuFangYao) {
        return true;
    }
}
